import type { RouteRecordRaw } from "vue-router";
import commonRoutes from "./common";
import testRoutes from "./test";
import curdRoutes from "./curd";
import { House } from "@element-plus/icons-vue";
import { homePath, rootPath } from "../config";

export const routes: RouteRecordRaw[] = [
  {
    path: rootPath,
    name: "AppRoot",
    meta: {
      title: "",
    },
    redirect: homePath,
  },
  {
    path: homePath,
    name: "Home",
    meta: {
      title: "首页",
      keepAlive: true,
      menu: {
        show: true,
        icon: House,
      },
      permission: {},
    },
    component: () =>
      import.meta.env.MODE === "development"
        ? import("@/pages/home/Home.vue")
        : import("@/pages/home/Welcome.vue"),
  },

  /** ----其他模块放这下面 开始------  */

  ...testRoutes,

  ...curdRoutes,

  /** ----其他模块放这上面 结束------  */

  /** 通用模块路由配置 !!! 保证该模块放置最后 */
  ...commonRoutes,
];
